package com.behavior.chainOfResponsibility.cuisine;

import com.behavior.chainOfResponsibility.AuthInfo;
import com.behavior.chainOfResponsibility.AuthLink;

import java.text.ParseException;
import java.util.Date;

/**
 * @author xiaobing
 * @version 1.0
 * @date 2021/9/22 2:26 下午
 */
public class Level1AuthLink extends AuthLink {

    private Date beginDate = f.parse("2020-06-11 00:00:00");
    private Date endDate = f.parse("2020-06-19 23:59:59");

    public Level1AuthLink(String levelUserId, String levelUserName) throws ParseException {
        super(levelUserId, levelUserName);
    }

    @Override
    public AuthInfo doAuth(String uId, String orderId, Date authDate) {
        if (authDate.before(endDate) && authDate.after(beginDate)) {
            return new AuthInfo("0000", "单号：", orderId, " 状态：一级审批完成负责人", " 时间：", f.format(authDate), " 审批人：", levelUserName);
        }

        return null;
    }
}
